package com.sun.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ConsumerTwoController {

    @Autowired
    private RestTemplate restTemplate;

    private static final String SERVER_URL = "http://cloud-alibaba-provider";

    @RequestMapping("/test2")
    public String test() {
        return "cloud-alibaba-consumer-two" + restTemplate.getForObject(SERVER_URL + "/hello" , String.class);
    }
}
